<template>
  <div>自定义</div>
  <button @click="sendid">传递id给父组件</button>
</template>
<script setup>
import { ref, defineEmits,onMounted } from "vue";
const emit = defineEmits(["sendId"], ["sendMoney"]); //事件发射器
function sendid() {
  // 发送事件
  emit("sendId", id.value);
}
onMounted(()=>{
emit('sendMoney',money.value)
})
let money = ref(99999);
let id = ref(1001);
</script>
